-
Notifications
You must be signed in to change notification settings - Fork 954
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed APIError: [403]
when copying permissions
#1515
base: master
Are you sure you want to change the base?
Conversation
hi ! thanks for the change :) I have fixed a couple of linting issues. There is a typing issue that otherwise, I think your change makes sense. we will try to get the workflows fixed and then think about merging :) |
Hey @lavigne958 I would like to help with fixing this and pushing it along. Could you share what should be tested and to what degree? |
hi :] shame @lavigne958 is busy I think the error has to do with the typing of the return value of this function(?), so mypy complains that you cannot use gspread/gspread/spreadsheet.py Lines 546 to 548 in 6775c81
do you think it is possible to add a test that can fail/pass this bug, so we do not re-introduce it in future? |
Yup, had to add an additional Typing definition - Found, fixed and tested. Linting isn't screaming anymore with an error.
I was thinking of adding something like below: This would test both copying of permissions and then on top of that, that being done in the Shared Drive. I'm testing on my company drive so my test service account doesn't have the permission to delete the file which is done at the end of the test. I'm awaiting my manager's approval on account getting a temporary full access so it can delete the files in that folder in the Shared Drive and successfully complete the test. |
This PR fixes the bug raised in the issue #1507.
tox test (replaced the first part of the path with
local_dir
to remove personal information):Also tested by copying a random spreadsheet in my workspace. For debugging I added a print in the
if
block:The result (screenshot):
011...
has theorganizer
role which is a folder permission, skipping...027...
has thefileOrganizer
role which is a folder permission, skipping...029...
has thecommenter
role, adding permission033...
has thefileOrganizer
role which is a folder permission, skipping...061...
has theorganizer
role which is a folder permission, skipping...083...
has thefileOrganizer
role which is a folder permission, skipping...085...
has thefileOrganizer
role which is a folder permission, skipping...087...
has theorganizer
role which is a folder permission, skipping...131...
has thewriter
role, adding permission134...
has thefileOrganizer
role which is a folder permission, skipping...146...
has thefileOrganizer
role which is a folder permission, skipping...152...
has theorganizer
role which is a folder permission, skipping...Correctly shared:
